/*
<!--
$(document).ready
(
    function ()
    {
	var validateLogin = $('#validateLogin');
	$('#login').blur
	(
	    function ()
	    {
		if ((this.value != this.lastValue) && (this.value.length > 0))
		{
		    var t = this;

		    validateLogin.removeClass('error').html('<img src="/img/ajax-loader.gif" height="16" width="16" />');
		    var r = /^[\w\s\-\d]+$/;

		    if(r.test(t.value))
		    {
			$.ajax({
			    url: '/inc/validate_registration.inc.php',
			    data: 'action=check_login&login=' + t.value,
			    dataType: 'json',
			    type: 'post',
			    success: function (j) {
				if(j.ok)
                                {
				    validateLogin.html('<font color="green"><b>'+j.msg+'</b></font>');
                                    enableSubmit();
                                }
				else
                                {
				    validateLogin.html('<font color="red">'+j.msg+'</font>');
                                    disableSubmit();
                                }
			    }
			});
		    }
		    else
		    {
			validateLogin.html('<font color="red">Wrong characters</color>');
                        disableSubmit();
		    }
		}

		if(this.value.length == 0)
                {
		    validateLogin.html('');
                    disableSubmit();
                }
	    }
	);

	var validateEmail = $('#validateEmail');
	$('#email').blur
	(
	    function ()
	    {
		if ((this.value != this.lastValue) && (this.value.length > 0))
		{
		    var t = this;

		    validateEmail.removeClass('error').html('<img src="/img/ajax-loader.gif" height="16" width="16" />');

                    $.ajax({
                        url: '/inc/validate_registration.inc.php',
                        data: 'action=check_email&email=' + t.value,
                        dataType: 'json',
                        type: 'post',
                        success: function (j) {
                            if(j.ok)
                                validateEmail.html('<font color="green"><b>'+j.msg+'</b></font>');
                            else
                                validateEmail.html('<font color="red">'+j.msg+'</font>');
                        }
                    });
		 }

		 if(this.value.length == 0)
		    validateEmail.html('');

	    }
	);
    }
);

    //-->

function removeHTMLTags(htmlString)
{
     var strTagStrippedText = htmlString.replace(/<\/?[^>]+(>|$)/g, "");

     return strTagStrippedText;
}

function checkForm()
{
    var login = document.getElementById("login");
    var password = document.getElementById("password");
    var password2 = document.getElementById("password2");
    var email = document.getElementById("email");
    var err = $('#error');

    if(login.value.length == 0 || password.value.length == 0 || password2.value.length == 0 || email.value.length == 0)
    {
            err.html('<font color="red">Not all fields are filled</font>');
            return false;
    }

    var validateLogin = document.getElementById("validateLogin");
    var validatePassword = document.getElementById("validatePassword");
    var validatePassword2 = document.getElementById("validatePassword2");
    var validateEmail = document.getElementById("validateEmail");

    var val_login = removeHTMLTags(validateLogin.innerHTML);
    var val_pass = removeHTMLTags(validatePassword.innerHTML);
    var val_pass2 = removeHTMLTags(validatePassword2.innerHTML);
    var val_email = removeHTMLTags(validateEmail.innerHTML);

    if((val_login != 'OK' && val_login != '') ||
	(val_pass != 'OK' && val_pass != '') ||
	(val_pass2 != 'OK' && val_pass != '') ||
	(val_email != 'OK' && val_email != ''))
    {
            err.html('<font color="red">There are some errors</font>');
            return false;
    }

    return true;
}
*/

window.onload=function() {document.getElementById("login").focus()};